Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Timex.before? and Timex.after? #4552

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Sep 9, 2024

Continues #4338

Changes

This PR continues the removal of Timex by replacing Timex.before? and Timex.after? with similar Date and NaiveDateTime functions.

Tests

  • This PR does not require tests

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

@@ -18,7 +18,7 @@ defmodule Plausible.Billing.Quota.Limits do

@spec site_limit(User.t()) :: non_neg_integer() | :unlimited
def site_limit(user) do
if Timex.before?(user.inserted_at, @limit_sites_since) do
if Date.before?(user.inserted_at, @limit_sites_since) do
Copy link
Contributor Author

@ruslandoga ruslandoga Sep 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@limit_sites_since is a date -- ~D[2021-05-05] -- and user.inserted_at is a naive datetime.

Comparisons use "least common denominator" sort-of logic, so Date module needs to be used to compare the two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant